<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>09_新增全局属性</title>
    <style>
      div {
        width: 600px;
        height: 200px;
        border: 1px solid black;
        font-size: 20px;
        margin-bottom: 10x;
      }

      .box1 {
        background-color: skyblue;
      }

      .box2 {
        background-color: green;
        position: relative;
      }
    </style>
  </head>
  <body>
    <div class="box1">
      Lorem, ipsum dolor sit amet consectetur adipisicing elit. Animi, aut?
    </div>

    <div class="box2" id="drg" draggable="true" ondragend="go(event)">
      Lorem, ipsum dolor sit amet consectetur adipisicing elit. Quam, itaque.
    </div>

    <div class="box3" id="dta" data-a="1" data-b="2" data-c="3"></div>
  </body>

  <script>
    // console.log(dta.dataset);

    function go(event) {
      //   console.log(event);
      drg.style.left = event.clientX + "px";
      drg.style.top = event.clientY + "px";
    }
  </script>
</html>
